home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 2 / Apprentice-Release2.iso / Source Code / C / Games / NetHack 3.1.3 / source / include / unixconf.h < prev    next >
Encoding:
C/C++ Source or Header  |  1993-08-01  |  7.9 KB  |  262 lines  |  [TEXT/R*ch]

  1. /*    SCCS Id: @(#)unixconf.h    3.1    90/22/02    */
  2. /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
  3. /* NetHack may be freely redistributed.  See license for details. */
  4.  
  5. #ifdef UNIX
  6. #ifndef UNIXCONF_H
  7. #define UNIXCONF_H
  8.  
  9. /*
  10.  * Some include files are in a different place under SYSV
  11.  *    BSD           SYSV
  12.  * <sys/time.h>        <time.h>
  13.  * <sgtty.h>        <termio.h>
  14.  *
  15.  * Some routines are called differently
  16.  * index        strchr
  17.  * rindex        strrchr
  18.  *
  19.  */
  20.  
  21. /* define exactly one of the following four choices */
  22. #define BSD        /* define for 4.n BSD  */
  23.             /* also for relatives like SunOS, Linux and DG/UX */
  24. /* #define ULTRIX    /* define for Ultrix v3.0 or higher (but not lower) */
  25.             /* Use BSD for < v3.0 */
  26.             /* "ULTRIX" not to be confused with "ultrix" */
  27. /* #define SYSV        /* define for System V */
  28. /* #define HPUX        /* Hewlett-Packard's Unix, version 6.5 or higher */
  29.             /* use SYSV for < v6.5 */
  30.  
  31.  
  32. /* define any of the following that are appropriate */
  33. /* #define SVR4        /* use in addition to SYSV for System V Release 4 */
  34. #define NETWORK    /* if running on a networked system */
  35.             /* e.g. Suns sharing a playground through NFS */
  36. #define SUNOS4    /* SunOS 4.x */
  37. /* #define LINUX  /* Another Unix clone running on Intel processors */
  38. /* #define GENIX    /* Yet Another Unix Clone */
  39. /* #define HISX        /* Bull Unix for XPS Machines */
  40. /* #define BOS        /* Bull Open Software - Unix for DPX/2 Machines */
  41. /* #define UNIXPC    /* use in addition to SYSV for AT&T 7300/3B1 */
  42. /* #define AIX_31    /* In AIX 3.1 (IBM RS/6000) use BSD ioctl's to gain
  43.                job control (note that AIX is SYSV otherwise) */
  44. /* #define TEXTCOLOR    /* Use System V r3.2 terminfo color support */
  45.             /* or ANSI color support on termcap systems */
  46.             /* or X11 color    */
  47. /* #define POSIX_JOB_CONTROL    /* use System V POSIX job control */
  48. /* #define POSIX_TYPES    /* use POSIX types for system calls and termios */
  49.                         /* define for platforms using the GNU libraries */
  50.                         /* linux, etc .. */
  51.  
  52. /* #define OPENWINBUG    /* avoid a problem using OpenWindows 3.0 for X11
  53.                on SunOS 4.1.x, x>= 2 */
  54. /* #define PYRAMID_BUG    /* avoid a bug on the Pyramid */
  55. /* #define BSD_43_BUG    /* for real 4.3BSD cc's without schain botch fix */
  56. /* #define MICROPORT_BUG /* problems with large arrays in structs */
  57. /* #define MICROPORT_286_BUG /* Changes needed in termcap.c to get it to
  58.                run with Microport Sys V/AT version 2.4.
  59.                By Jay Maynard */
  60. /* #define AIXPS_2BUG    /* avoid a problem with little_to_big() optimization */
  61.  
  62. /* #define RANDOM    /* if neither random/srandom nor lrand48/srand48
  63.                is available from your system */
  64.  
  65. /* see sys/unix/snd86.shr for more information on these */
  66. /* #define UNIX386MUSIC    /* Play real music through speaker on systems with
  67.                music driver installed */
  68. /* #define VPIX_MUSIC    /* Play real music through speaker on systems with
  69.                built-in VPIX support */
  70.  
  71.  
  72. /*
  73.  * The next two defines are intended mainly for the Andrew File System,
  74.  * which does not allow hard links.  If NO_FILE_LINKS is defined, lock files
  75.  * will be created in LOCKDIR using open() instead of in the playground using
  76.  * link().
  77.  *        Ralf Brown, 7/26/89 (from v2.3 hack of 10/10/88)
  78.  */
  79.  
  80. /* #define NO_FILE_LINKS    /* if no hard links */
  81. /* #define LOCKDIR "/usr/games/lib/nethackdir"    /* where to put locks */
  82.  
  83.  
  84. /*
  85.  * Define DEF_PAGER as your default pager, e.g. "/bin/cat" or "/usr/ucb/more"
  86.  * If defined, it can be overridden by the environment variable PAGER.
  87.  * Hack will use its internal pager if DEF_PAGER is not defined.
  88.  * (This might be preferable for security reasons.)
  89.  * #define DEF_PAGER    ".../mydir/mypager"
  90.  */
  91.  
  92.  
  93.  
  94. /*
  95.  * Define PORT_HELP to be the name of the port-specfic help file.
  96.  * This file is found in HACKDIR. 
  97.  * Normally, you shouldn't need to change this.
  98.  * There is currently no port-specific help for Unix systems.
  99.  */
  100. /* #define PORT_HELP "Unixhelp" */
  101.  
  102. /*
  103.  * If you define MAIL, then the player will be notified of new mail
  104.  * when it arrives.  If you also define DEF_MAILREADER then this will
  105.  * be the default mail reader, and can be overridden by the environment
  106.  * variable MAILREADER; otherwise an internal pager will be used.
  107.  * A stat system call is done on the mailbox every MAILCKFREQ moves.
  108.  */
  109.  
  110. #define MAIL            /* Deliver mail during the game */
  111.  
  112. /* The Andrew Message System does mail a little differently from normal
  113.  * UNIX.  Mail is deposited in the user's own directory in ~/Mailbox
  114.  * (another directory).  MAILBOX is the element that will be added on to
  115.  * the user's home directory path to generate the Mailbox path - just in
  116.  * case other Andrew sites do it differently from CMU.
  117.  *
  118.  *        dan lovinger
  119.  *        dl2n+@andrew.cmu.edu (dec 19 1989)
  120.  */
  121.  
  122. /* #define AMS            /* use Andrew message system for mail */
  123.  
  124. /* NO_MAILREADER is for kerberos authentcating filesystems where it is
  125.  * essentially impossible to securely exec child processes, like mail
  126.  * readers, when the game is running under a special token.
  127.  *
  128.  *             dan
  129.  */
  130.  
  131. /* #define NO_MAILREADER    /* have mail daemon just tell player of mail */
  132.  
  133. #ifdef    MAIL
  134. # if defined(BSD) || defined(ULTRIX)
  135. #  ifdef AMS
  136. #define AMS_MAILBOX    "/Mailbox"
  137. #  else
  138. #define DEF_MAILREADER    "/usr/ucb/Mail"
  139. #  endif
  140. #else
  141. # if defined(SYSV) || defined(DGUX) || defined(HPUX)
  142. #  ifdef M_XENIX
  143. #define DEF_MAILREADER    "/usr/bin/mail"
  144. #  else
  145. #define DEF_MAILREADER    "/usr/bin/mailx"
  146. #  endif
  147. # else
  148. #define DEF_MAILREADER    "/bin/mail"
  149. # endif
  150. #endif
  151.  
  152. #define MAILCKFREQ    50
  153. #endif    /* MAIL */
  154.  
  155.  
  156.  
  157. #ifdef COMPRESS
  158. /* Some implementations of compress need a 'quiet' option.
  159.  * If you've got one of these versions, put -q here.
  160.  * You can also include any other strange options your compress needs.
  161.  * If you have a normal compress, just leave it commented out.
  162.  */
  163. /* #define COMPRESS_OPTIONS    "-q"    /* */
  164. #endif
  165.  
  166. #define FCMASK    0660    /* file creation mask */
  167.  
  168.  
  169. /*
  170.  * The remainder of the file should not need to be changed.
  171.  */
  172.  
  173. #ifdef _AUX_SOURCE
  174. # ifdef AUX /* gcc ? */
  175. #  define _SYSV_SOURCE
  176. #  define _BSD_SOURCE
  177. #else
  178. #  define AUX
  179. # endif
  180. #endif /* _AUX_SOURCE */
  181.  
  182. /*
  183.  * BSD/ULTRIX systems are normally the only ones that can suspend processes.
  184.  * Suspending NetHack processes cleanly should be easy to add to other systems
  185.  * that have SIGTSTP in the Berkeley sense.  Currently the only such systems
  186.  * known to work are HPUX and AIX 3.1; other systems will probably require
  187.  * tweaks to unixtty.c and ioctl.c.
  188.  *
  189.  * POSIX defines a slightly different type of job control, which should be
  190.  * equivalent for NetHack's purposes.  POSIX_JOB_CONTROL should work on
  191.  * various recent SYSV versions (with possibly tweaks to unixtty.c again).
  192.  */
  193. #ifndef POSIX_JOB_CONTROL
  194. # if defined(BSD) || defined(ULTRIX) || defined(HPUX) || defined(AIX_31)
  195. #  define BSD_JOB_CONTROL
  196. # else
  197. #  if defined(SVR4)
  198. #   define POSIX_JOB_CONTROL
  199. #  endif
  200. # endif
  201. #endif
  202. #if defined(BSD_JOB_CONTROL) || defined(POSIX_JOB_CONTROL) || defined(AUX)
  203. #define SUSPEND        /* let ^Z suspend the game */
  204. #endif
  205.  
  206.  
  207. #if defined(BSD) || defined(ULTRIX)
  208. #include    <sys/time.h>
  209. #else
  210. #include    <time.h>
  211. #endif
  212.  
  213. #define HLOCK    "perm"    /* an empty file used for locking purposes */
  214.  
  215. #ifndef REDO
  216. #define Getchar nhgetch
  217. #endif
  218. #define tgetch getchar
  219.  
  220. #define SHELL        /* do not delete the '!' command */
  221.  
  222. #include "system.h"
  223.  
  224. #if defined(BSD) || defined(ULTRIX)
  225. # if !defined(DGUX) && !defined(SUNOS4)
  226. #define memcpy(d, s, n)        bcopy(s, d, n)
  227. #define memcmp(s1, s2, n)    bcmp(s2, s1, n)
  228. # endif
  229. #else    /* therefore SYSV */
  230. # ifndef index    /* some systems seem to do this for you */
  231. #define index    strchr
  232. # endif
  233. # ifndef rindex
  234. #define rindex    strrchr
  235. # endif
  236. #endif
  237.  
  238. /* A safety check for BOS and AUX */
  239. #if (defined(BOS) || defined(AUX)) && defined(NHSTDC)
  240. # if defined(VISION_TABLES) && defined(BRACES)
  241. #  undef BRACES
  242. # endif
  243. #endif
  244.  
  245. /* Use the high quality random number routines. */
  246. #if defined(BSD) || defined(ULTRIX) || defined(RANDOM)
  247. #define Rand()    random()
  248. #else
  249. #define Rand()    lrand48()
  250. #endif
  251.  
  252. #ifdef hc    /* older versions of the MetaWare High-C compiler define this */
  253. # ifdef __HC__
  254. #  undef __HC__
  255. # endif
  256. # define __HC__ hc
  257. # undef hc
  258. #endif
  259.  
  260. #endif /* UNIXCONF_H */
  261. #endif /* UNIX */
  262.